<template lang="html">
  <div class="test-papers">
    <TopClose :topCloseText='topCloseText' />
    <TextLibrary :LungtestData='LungtestData' @setPage='getPage'/>
  </div>
</template>

<script>
import TopClose from '../../components/TopClose'
import TextLibrary from '../../components/Index/TextLibrary'
export default {
  name:'TestPapers',
  components:{
    TopClose,
    TextLibrary
  },
  data(){
    return{
      topCloseText:{
        title:'肺部测试',
        flag:true
      },
      LungtestData:{}
    }
  },
  methods:{
    // lungtest 网络请求
    GetlungtestHttp(page){
      this.$axios.get(this.HOST + '/api/lungtest?page=' +page)
      .then(res => {
        this.LungtestData = res.data
      })
      .catch(error => {
        console.log(error);
      })
    },
    // 接收配置
    getPage(page){
      if(page <= 6 ){
        this.GetlungtestHttp(page);
      }else{
        page = 6;
      }
    }
  },
  created(){
    this.GetlungtestHttp(1);
  }
}
</script>

<style lang="less" scoped>
</style>
